﻿<UserControl x:Class="ViCode_LeVi.Controls.VMTaskItemDetail"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:vmcontrol="clr-namespace:ViCode_LeVi.Controls"
        xmlns:Langs="clr-namespace:ViCode_LeVi.Langs"
        xmlns:Data="clr-namespace:ViCode_LeVi.Data">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid Grid.Column="0" Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="TaskItem_Name_Text" Margin="2"/>
            <vmcontrol:VMTextBox  Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" Text="{Binding Name}" Margin="2"/>

            <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="TaskItem_Define_Text" Margin="2"/>
            <vmcontrol:VMTextBox_MultiLine Grid.Column="1" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Define}" AcceptsReturn="True"  ScrollViewer.VerticalScrollBarVisibility="Auto" MinLines="3" Margin="2"/>

        </Grid>

        <GroupBox Grid.Column="0" Grid.Row="1">
            <GroupBox.HeaderTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding Path=DataContext.Quantity_Checked, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}">
                        <CheckBox.Content>
                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_Quantity_Text"/>
                        </CheckBox.Content>
                    </CheckBox>
                </DataTemplate>
            </GroupBox.HeaderTemplate>
            <Grid Grid.Column="0" Grid.Row="0" IsEnabled="{Binding Quantity_Checked}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="3*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                </Grid.RowDefinitions>

                <Grid Grid.Column="0" Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_Question_Text" Margin="2"/>
                    <vmcontrol:VMTextBox_MultiLine  Grid.Column="0" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Quantity_Question}" AcceptsReturn="True"   ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="2"/>
                </Grid>

                <StackPanel Grid.Column="1" Grid.Row="0" VerticalAlignment="Bottom">
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_ISTWeight_Percent_Text" Margin="2"/>
                    <vmcontrol:VMTextBox  Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch"  Margin="2">
                        <vmcontrol:VMTextBox.Text>
                            <Binding Path="Quantity_WeightPercent" UpdateSourceTrigger="PropertyChanged" >
                                <Binding.ValidationRules>
                                    <Data:PercentRangeRule Min="0" Max="100"/>
                                </Binding.ValidationRules>
                            </Binding>
                        </vmcontrol:VMTextBox.Text>
                    </vmcontrol:VMTextBox>

                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_Evaluation_Text" Margin="2"/>
                    <Grid>
                        <vmcontrol:VMTextBox x:Name="TextBox_Quantity_Image" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="2" Focusable="False">
                        </vmcontrol:VMTextBox>
                        <Image Height="{Binding ImageHeight}" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Source="{Binding Quantity_Evaluation_Image}"  Margin="2"/>
                    </Grid>
                </StackPanel >

                <Grid Grid.Column="2" Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_Anwser_Text" Margin="2"/>
                    <vmcontrol:VMTextBox_MultiLine  Grid.Column="0" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Quantity_Answer}" AcceptsReturn="True"   ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="2"/>
                </Grid>
            </Grid>
        </GroupBox>

        <GroupBox Grid.Column="0" Grid.Row="2">
            <GroupBox.HeaderTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding Path=DataContext.Quanlity_Checked, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}">
                        <CheckBox.Content>
                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_Quanlity_Text"/>
                        </CheckBox.Content>
                    </CheckBox>
                </DataTemplate>
            </GroupBox.HeaderTemplate>
            <Grid Grid.Column="0" Grid.Row="0" IsEnabled="{Binding Quanlity_Checked}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="3*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                </Grid.RowDefinitions>

                <Grid Grid.Column="0" Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_Question_Text" Margin="2"/>
                    <vmcontrol:VMTextBox_MultiLine  Grid.Column="0" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Quanlity_Question}" AcceptsReturn="True"   ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="2"/>
                </Grid>

                <StackPanel Grid.Column="1" Grid.Row="0" VerticalAlignment="Bottom">
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_ISTWeight_Percent_Text" Margin="2"/>
                    <vmcontrol:VMTextBox  Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch"  Margin="2">
                        <vmcontrol:VMTextBox.Text>
                            <Binding Path="Quanlity_WeightPercent" UpdateSourceTrigger="PropertyChanged" >
                                <Binding.ValidationRules>
                                    <Data:PercentRangeRule Min="0" Max="100"/>
                                </Binding.ValidationRules>
                            </Binding>
                        </vmcontrol:VMTextBox.Text>
                    </vmcontrol:VMTextBox>

                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_Evaluation_Text" Margin="2"/>
                    <Grid>
                        <vmcontrol:VMTextBox x:Name="TextBox_Quanlity_Image" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="2" Focusable="False">
                        </vmcontrol:VMTextBox>
                        <Image Height="{Binding ImageHeight}" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Source="{Binding Quanlity_Evaluation_Image}"  Margin="2"/>
                    </Grid>
                </StackPanel >

                <Grid Grid.Column="2" Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_Anwser_Text" Margin="2"/>
                    <vmcontrol:VMTextBox_MultiLine Grid.Column="0" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Quanlity_Answer}" AcceptsReturn="True"   ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="2"/>
                </Grid>
            </Grid>
        </GroupBox>

        <GroupBox Grid.Column="0" Grid.Row="3">
            <GroupBox.HeaderTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding Path=DataContext.Systematic_Checked, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}">
                        <CheckBox.Content>
                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_Systematic_Text"/>
                        </CheckBox.Content>
                    </CheckBox>
                </DataTemplate>
            </GroupBox.HeaderTemplate>
            <Grid Grid.Column="0" Grid.Row="0" IsEnabled="{Binding Systematic_Checked}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="3*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                </Grid.RowDefinitions>

                <Grid Grid.Column="0" Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_Question_Text" Margin="2"/>
                    <vmcontrol:VMTextBox_MultiLine  Grid.Column="0" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Systematic_Question}" AcceptsReturn="True"   ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="2"/>
                </Grid>

                <StackPanel Grid.Column="1" Grid.Row="0" VerticalAlignment="Bottom">
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_ISTWeight_Percent_Text" Margin="2"/>
                    <vmcontrol:VMTextBox  Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch"  Margin="2">
                        <vmcontrol:VMTextBox.Text>
                            <Binding Path="Systematic_WeightPercent" UpdateSourceTrigger="PropertyChanged" >
                                <Binding.ValidationRules>
                                    <Data:PercentRangeRule Min="0" Max="100"/>
                                </Binding.ValidationRules>
                            </Binding>
                        </vmcontrol:VMTextBox.Text>
                    </vmcontrol:VMTextBox>

                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_Evaluation_Text" Margin="2"/>
                    <Grid>
                        <vmcontrol:VMTextBox x:Name="TextBox_Systematic_Image" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="2" Focusable="False">
                        </vmcontrol:VMTextBox>
                        <Image Height="{Binding ImageHeight}" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Source="{Binding Systematic_Evaluation_Image}"  Margin="2"/>
                    </Grid>
                </StackPanel >

                <Grid Grid.Column="2" Grid.Row="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" TextPath="TaskItem_Anwser_Text" Margin="2"/>
                    <vmcontrol:VMTextBox_MultiLine  Grid.Column="0" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Systematic_Answer}" AcceptsReturn="True"   ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="2"/>
                </Grid>
            </Grid>
        </GroupBox>
        
        <StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Name="Button_OK" Content="{Binding Source={x:Static Langs:ControlTextInfo.Intance}, Path=Button_Content_OK}" Margin="2"/>
            <Button Name="Button_Cancel" Content="{Binding Source={x:Static Langs:ControlTextInfo.Intance}, Path=Button_Content_Cancel}" Margin="2"/>
        </StackPanel>
    </Grid>
</UserControl>
